package service;

import java.util.List;

import bean.Distance;
import bean.Point;
import bean.Road;
import bean.RoadStatus;
import bean.Tile;
import bean.Vehicle;
import exception.DBException;

public interface RoadService {
	public boolean saveOrUpdate(List<Road> roads) throws DBException;
	public List<Road> queryAllRoadsInArea(int area) throws DBException;
	public boolean removeRoadById(int id) throws DBException;
	public List<Distance> restoreDistance(int area) throws DBException;

	/**
	 * 
	 * @param area 表示当前地图所属区域
	 * @param start 表示寻路的起点
	 * @param end 表示寻路终点
	 * @param update 表示distance是否要更新，true=要。
	 * @return
	 * @throws DBException
	 */
	public List<Point> shortestPath(int area,Point start,Point end,boolean update) throws DBException;
	public List<Distance> distanceFromLights(int area) throws DBException;
	public List<Vehicle> getCurrentVehicleMovement(int area) throws DBException;
	public List<RoadStatus> calculateRoadStatus(int area)throws DBException;
	public List<Tile> getAllTiles() throws DBException;
	public boolean saveOrUpdateTiles(List<Tile> tiles) throws DBException;
	/**
	 * 通过当前车辆（默认ID=1）为圆心，R为半径，画圆，圆外的的车辆前台不画出
	 * @param ves
	 * @return
	 * @throws DBException
	 */
	public List<Vehicle> circleFilter(List<Vehicle> ves,int id) throws DBException;
	/**
	 * 扫描圆半径
	 */
	public final static  int RADIUS=90;
}
